<?php 
/*
 module:		价格管理验证器
 create_time:	2021-09-24 18:27:25
 author:		
 contact:		
*/

namespace app\admin\validate\Customer;
use think\validate;

class Money extends validate {


	protected $rule = [
		'original_price'=>['regex'=>'/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/'],
		'price'=>['regex'=>'/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/'],
		'minute'=>['regex'=>'/^[0-9]*$/'],
	];

	protected $message = [
		'original_price.regex'=>'原价格式错误',
		'price.regex'=>'现价格式错误',
		'minute.regex'=>'分钟格式错误',
	];

	protected $scene  = [
		'add'=>['original_price','price','minute'],
		'edit'=>['original_price','price','minute'],
	];



}

